<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./adminTemplate.xhtml">

            <ui:define name="title">
                Add Admin
            </ui:define>

            <ui:define name="contain">
                <h:form id="form" enctype="multipart/form-data">
                    <h2 class="ico_mug">Add Admin</h2>
                    <h:panelGrid columns="3" cellpadding="8px" cellspacing="10px" id="panel">
                        <h:outputLabel value="Username: " />
                        <p:inputText value="#{adminBean.username}" id="username" requiredMessage="Please input username" required="true" style="width: 196px"/>
                        <p:message for="username"/>

                        <h:outputLabel value="Password: " />
                        <p:password value="#{adminBean.password}" id="password" feedback="false" requiredMessage="Please input password" required="true" style="width: 196px"/>  
                        <p:message for="password"/>

                        <h:outputLabel value="Fullname: " />
                        <p:inputText value="#{adminBean.fullname}" id="fullname" requiredMessage="Please input fullname" required="true" style="width: 196px"/>
                        <p:message for="fullname"/>

                        <h:outputLabel value="Address: " />
                        <p:inputText value="#{adminBean.address}" id="address" requiredMessage="Please input address" required="true" style="width: 196px"/>
                        <p:message for="address"/>
                        
                        <h:outputLabel value="Phone: " />
                        <p:inputText value="#{adminBean.phone}" id="phone" requiredMessage="Please input phone" required="true" style="width: 196px"/>
                        <p:message for="phone"/>

                        &nbsp;
                        <p:column colspan="2">
                            <p:commandButton value="Submit" action="#{adminController.processRegister()}" update="form" /> 
                            <p:commandButton type="reset" value="Reset" /> 
                        </p:column>
                    </h:panelGrid>
                    <p:messages autoUpdate="true" showDetail="true" showSummary="false" globalOnly="true"></p:messages> 
                </h:form> 
            </ui:define>

        </ui:composition>

    </body>
</html>
